<template>
	<view class="myMap-content">
		<Map :myPosition='myPosition'></Map>
	</view>
</template>

<script>
	import Map from "@/component/gdMap/index.vue"
	export default {
		components: {
			Map
		},
		data() {
			return {
				myPosition: []
			}
		},
		onLoad() {
			this.getUserLocation()
		},
		methods: {
			// 获取用户当前定位
			getUserLocation() {
				let that = this
				uni.getLocation({
					type: 'wgs84',
					success: function(res) {
						that.myPosition.push(res.longitude)
						that.myPosition.push(res.latitude)
						console.log(that.myPosition,'当前定位');
					}
				});
			}
		}
	}
</script>



<style>
</style>